package com.kinglone.back.user.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.kinglone.back.permission.model.Permission;
import com.kinglone.back.user.dao.UserMapper;
import com.kinglone.back.user.model.User;
import com.kinglone.back.user.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {

	@Resource
	private UserMapper userDao;
	
	@Override
	public User getByUserName(String accountName) {
		
		return userDao.findUserByUserName(accountName);
	}

	@Override
	public Integer update(User user) {
		return userDao.update(user);
	}

	@Override
	public List<User> getAllUsers() {
		return userDao.getAllUsers();
	}

	@Override
	public void addUser(User user) {
		userDao.addUser(user);
	}

	@Override
	public List<User> getUsersByRoleId(String roleId) {
		return userDao.getUsersByRoleId(roleId);
	}

	@Override
	public List<Permission> findMenuListByUserId(String userId) {
	
		return userDao.findMenuListByUserId(userId);
	}

	@Override
	public void delUserByUserId(String userId) {
		userDao.delUserByUserId(userId);
		
	}

}
